package com.kakarote.gateway.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author zhangzhiwei
 * 默认的一些配置
 */
@Component
@ConfigurationProperties(prefix = "wk.gateway")
@RefreshScope
public class GatewayConfiguration {
    /**
     * 不验证权限的url
     */
    public Set<String> ignoreUrl;


    public Set<String> getIgnoreUrl() {
        if (ignoreUrl == null) {
            return Collections.emptySet();
        }
        return ignoreUrl;
    }

    public void setIgnoreUrl(List<String> ignoreUrl) {
        this.ignoreUrl = new HashSet<>(ignoreUrl);
    }
}
